package com.example.activiti.demo.delegate;

import lombok.extern.slf4j.Slf4j;
import org.activiti.engine.ActivitiException;
import org.activiti.engine.delegate.DelegateExecution;
import org.activiti.engine.delegate.JavaDelegate;

/**
 * 失败重试3次
 */
@Slf4j
public class FailRetryJavaDelegate implements JavaDelegate {
    private int i = 0;


    @Override
    public void execute(DelegateExecution execution) {

        log.info("xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");
        i++;
        System.out.println("===================失败重试3次,这是第【" + i + "次】重试=================");

        throw new ActivitiException("失败重试,i=" + i);

    }
}
